﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class DefaultResponse : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //Response.ContentType 设置http输出流的类型，默认为"text/html"
        Response.ContentType = "image/jpeg";
        Response.WriteFile("~/Images/btn.jpg");
        //终止页面的执行，将不执行后面的代码
        Response.End();
        Response.ContentType = "text/plain";
        Response.Write(Response.ContentType + "<br>");
        //Response.Charset 设置HTTP输出流的字符集，默认为utf-8
        Response.Charset = "bgk";
        Response.Write(Response.Charset + "<br>");
        //Write()方法：在页面上输出信息
        Response.Write("Response的Write方法");

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        // ？:表示Get Method方法，后面表示传递的参数和参数的值
        //Redirect（）方法：页面重定向，可通过URL附加查询字符串实现不同页面之间的数据传递
        Response.Redirect("~/Default.aspx?page=10");
    }
}